package springboot.util;

import java.util.List;
import java.util.Map;

public abstract class BlankUtil {

	private BlankUtil() {
		
	}
	/**
	 * 集合
	 * map
	 * 数组
	 * 字符串
	 * 
	 */
	public static boolean isBlank(Object obj) {
		if (obj==null) {
			return true;
		}
		
		if (obj instanceof List) {
			if (((List) obj).size()==0) {
				return true;
			}
		}
		
		if (obj instanceof Map) {
			if (((Map) obj).size()==0) {
				return true;
			}
		}
		
		if (obj instanceof String) {
			if (((String) obj).trim().length()==0) {
				return true;
			}
		}
		
		return false;
	}
	
	public static boolean isNoBlank(Object obj) {
		
		return !isBlank(obj);
	}
	
	
}
